/**
 * Created by qingmai on 2017/2/17.
 */
var gulp = require('gulp'),
    config = require('../config'),
    livereload = require('gulp-livereload'),
    order = require("gulp-order"),
    concat = require('gulp-concat');

// 合并js
gulp.task('jslist',function () {
    gulp.src(config.src.scripts)
        .pipe(order([   
        	'config.js',
            'zhong.js',
            'login.js',
            'userinfo.js',
            'Verification.js',
            'security.js',
            'withdrawal.js',
            'transaction.js',
            'k_line.js',
            'hangqing.js',
            'information.js',
            'aboutus.js',
            'invitefriends.js'
           
           
           
            ]))
        .pipe(concat('index.js'))    //合并文件名
        .pipe(gulp.dest(config.dest.scripts))
        .pipe(livereload());
});
gulp.task('jsjont',function () {
    gulp.src(config.src.js)
        .pipe(gulp.dest(config.dest.scripts))
        .pipe(livereload())
});
gulp.task('script',function () {
    gulp.watch(config.src.scripts,['jslist']);
    gulp.watch(config.src.js,['jsjont']);
    livereload.listen();
})